import VueRouter from 'vue-router';
import Vue from 'vue';
import App from '../app.vue';
/*import register from '../page/register.vue';
import home from '../page/home.vue';
import cart from '../page/cart.vue';
import order from '../page/order.vue';
import center from '../page/center.vue';
import store from '../page/store.vue';
import commodity from '../page/commodity.vue';
import productDetails from '../page/productDetails';
import globule from '../page/globule';*/

/*import orderAll from '../components/orderAll.vue';
import obligation from '../components/obligation.vue';
import indent3 from '../components/indent3.vue';
import pending from '../components/pending.vue';
import waitForReceiving from '../components/waitForReceiving.vue';
import sevice from '../components/sevice.vue'
import addSite from '../components/addSite';
import myAddress from '../components/myAddress';
import login from '../components/login';
import ringUp from '../components/ringUp';
import authCode from '../components/authCode';
import fillInOrder from '../components/fillInOrder';*/
Vue.use(VueRouter);
const routes = [
  {
    path:'/',
    //路由重定向
    redirect:'/register'
  },
  {
    path:'/',
    component:resolve=>require(['@/app'],resolve),
    children:[
      {
        path:'register',
        name:'register',
        component:resolve=>require(['@/page/register'],resolve),
        children:[
          {
            path:'/register',
            //路由重定向
            redirect:'/register/ringUp'
          },
          {
            path:'ringUp',
            name:'ringUp',
            component:resolve=>require(['@/components/ringUp'],resolve)
          },
          {
            path:'login',
            name:'login',
            component:resolve=>require(['@/components/login'],resolve)
          },
          {
            path:'authCode',
            name:'authCode',
            component:resolve=>require(['@/components/authCode'],resolve)

          },

        ]
      },
      {
        path:'home',
        name:'home',
        component:resolve=>require(['@/page/home'],resolve),
      },
      {
        path:'globule',
        name:'globule',
        component:resolve=>require(['@/page/globule'],resolve),
      },
      {
        path:'store',
        name:'store',
        component:resolve=>require(['@/page/store'],resolve),
      },
      {
        path:'commodity',
        name:'commodity',
        component:resolve=>require(['@/page/commodity'],resolve),
      },
      {
        path:'cart',
        name:'cart',
        component:resolve=>require(['@/page/cart'],resolve),
      },
      {
        path:'order',
        name:'order',
        component:resolve=>require(['@/page/order'],resolve),
        children:[
          {
            path:'order',
            //路由重定向
            redirect:'order/orderAll'
          },
          {
            path:'orderAll',
            name:'orderAll',
            component:resolve=>require(['@/components/orderAll'],resolve)
          },
          {
            path:'obligation',
            name:'obligation',
            component:resolve=>require(['@/components/obligation'],resolve)
          },
          {
            path:'indent3',
            name:'indent3',
            component:resolve=>require(['@/components/indent3'],resolve)
          },
          {
            path:'pending',
            name:'pending',
            component:resolve=>require(['@/components/pending'],resolve)
          },
          {
            path:'waitForReceiving',
            name:'waitForReceiving',
            component:resolve=>require(['@/components/waitForReceiving'],resolve)
          }
        ]
      },
      {
        path:'center',
        name:'center',
        component:resolve=>require(['@/page/center'],resolve),
        children:[
          {
            path:'center',
            //路由重定向
            redirect:'center/sevice',

          },
          {
            path:'sevice',
            name:'sevice',
            component:resolve=>require(['@/components/sevice'],resolve)
          }
        ]
      },
      {
        path:'/productDetails',
        name:'productDetails',
        component:resolve=>require(['@/page/productDetails'],resolve),
      },
      {
        path:'addSite',
        name:'addSite',
        component:resolve=>require(['@/components/addSite'],resolve)
      },
      {
        path:'myAddress',
        name:'myAddress',
        component:resolve=>require(['@/components/myAddress'],resolve)
      },
      {
        path:'fillInOrder',
        name:'fillInOrder',
        component:resolve=>require(['@/components/fillInOrder'],resolve)
      }

    ]
  },
];
export const router = new VueRouter({
  routes,
  mode:'history'
});
